<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0">
	<link rel="stylesheet" href="../res/css/weui.css" />
    <link rel="stylesheet" href="../res/css/weuix.css" />
	<link rel="stylesheet" href="../res/css/common.css" />
    <title></title>
	<script src="../res/js/zepto.min.js"></script>
	<script src="../res/js/zepto.weui.js"></script>
    <!-- <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> -->
    <script src="../res/js/vue.min.js"></script>
	<script src="../res/js/common.js?v=1"></script>

    <style>
        body{
            height: 100%;
        }
        #app{
            display: flex;
            flex-direction: column;
            align-items: stretch;
            min-height: 100%;
        }
        .top-bar{
            position: sticky;
            position: -webkit-sticky;
            top: 0;
            z-index: 9;
            box-shadow: 0 0 8px -4px #e0e0e0;
        }
        .patients-list{
            flex: 1;
            margin: 10px;
        }
        .patient-item{
            list-style: none;
            padding: 5px 10px;
            border-radius: 8px;
            background-color:  #fff;
            box-shadow: 0 0 8px -2px #e0e0e0;
        }
        .patient-item + .patient-item{
            margin-top: 10px;
        }
        .user-name{
            font-size: 16px;
            font-weight: bold;
            line-height: 32px;
        }
        .one-person{
            margin-left: 9px;
            border: 1px solid #1189FF;
            border-radius: 4px;
            padding: 0px 10px;
            color: #1189FF;
            font-weight: normal;
            background-color: #ECF6FF;
        }
        .user-sex-age{
            font-size: 15px;
            display: flex;
            justify-content: space-between;
        }
        .show-case{
            color: #1189FF;
        }
    </style>
</head>
<body>
    <section id="app">
        <div class="weui-btn_primary weui-header top-bar">
            <div class="weui-header-left"><a class="icon icon-109" @click="pageBack"></a></div>
            <h1 class="weui-header-title">就诊人管理</h1>
        </div>

        <ul class="patients-list">
            <li v-for="item in patientsList" class="patient-item" @click="goToDetails(item.logId)">
                <div class="user-name">
                    {{item.patientName}}
                    <span class="one-person">{{relationList[item.relationType]}}</span>
                </div>
                <div class="user-sex-age">
                    <span>
                        {{item.patientSex == '1' ? '男' : '女'}}&nbsp;&nbsp;{{item.patientAge}}岁
                    </span>
                    <span class="show-case">
                        查看病历
                    </span>
                </div>
            </li>
        </ul>
    </section>
</body>
<script>
    const pppppappppp = new Vue({
        el: '#app',
        data: {
            patientsList: [],
            relationList: ['本人', '其他', '父母', '配偶', '子女']
        },
        methods: {
            pageBack(){
                history.back()
            },
            getData(){
                const that = this
                newAjaxPost('/h5/patientInfo/getInquiryPatientInfoList', {}, function (res) {
                    that.patientsList = res.data.list
                })
            },
            goToDetails(id){
                if (id) {   
                    goPage('case_details.htm?id=' + id)
                }else{
                    msgInfo("该就诊人尚无问诊记录", 1000)
                }
            }
        },
        mounted(){
            this.getData()
        }
    })
</script>
</html>